<?php

use Illuminate\Database\Migrations\Migration;
use Illuminate\Database\Schema\Blueprint;
use Illuminate\Support\Facades\Schema;

return new class extends Migration
{
    /**
     * Run the migrations.
     */
    public function up(): void
    {
        Schema::create('purchaser_user_addresses', function (Blueprint $table) {
            $table->id();
            $table->unsignedBigInteger('purchaser_user_id')->comment('采购商用户id');
            $table->string('address')->comment('地址');
            $table->string('province')->comment('省份');
            $table->string('city')->comment('市');
            $table->string('district_or_county')->comment('区县');
            $table->string('postal_code')->nullable()->comment('邮编');
            $table->string('recipient_name')->comment('收件人姓名');
            $table->string('phone_number')->comment('收件人电话号码');
            $table->unsignedTinyInteger('is_default')->default(1)->comment('是否默认 0 否 1 是');
            $table->timestamps();
        });
    }

    /**
     * Reverse the migrations.
     */
    public function down(): void
    {
        Schema::dropIfExists('purchaser_user_addresses');
    }
};
